// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()
  if(event.latitude-28.683125>0.5 || 28.683125-event.latitude>0.5){
    return {
      count:0
    }
  }
  if(event.longitude-115.93829>0.5 || 115.93829-event.longitude>0.5){
    return {
      count:0
    }
  }
  return {
    infos: [{
      latitude: 28.683125,
      longitude: 115.93829,
      //latitude:event.latitude,
      //longitude: event.longitude+0.002,
      callout: {
        content: "<南昌大学软件学院>\r\n软件楼保卫处\r\n保卫处的大爷可能不晓得AED在哪里\r\n如果实在找不到立刻去315或者210\r\n向办公室的老师寻求帮助",
        bgColor: "#fff",
        padding: "5px",
        borderRadius: "2px",
        borderWidth: "1px",
        borderColor: "#07c160",
      },
      iconPath: "https://6d61-main-wc2xz-1259126940.tcb.qcloud.la/daquan/icons/mapicon/location_red.png?sign=7002919cbb4552d33dbb265ad6c09f6f&t=1618307799"
    },{
      latitude: 28.68242,
      longitude: 115.961316,
      //latitude:event.latitude,
      //longitude: event.longitude+0.002,
      callout: {
        content: "<青山湖区人民政府>\r\n办公楼西楼一楼接待处对面\r\n就在墙上挂着，找不到的可以问问接待处的小姐姐",
        bgColor: "#fff",
        padding: "5px",
        borderRadius: "2px",
        borderWidth: "1px",
        borderColor: "#07c160",
      },
      iconPath: "https://6d61-main-wc2xz-1259126940.tcb.qcloud.la/daquan/icons/mapicon/location_red.png?sign=14e1388130de77b8a6123fc63d4ec995&t=1618307928"
    }],
    count: 2
  }
}